package com.itheima.pojo;

import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.List;

public class Menu2 implements Serializable {
    private int id;
    private String label;//菜单名(比如一级菜单,二级菜单...)
    private String linkUrl;//访问路径
    private String title;//标题
    private String icon;//图标
    private String path;//路径
    private List<Menu2> children;//子菜单

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getIcon() {
        if(null == icon && "".equals(icon)){
             return "fa-stethoscope";
        }
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getTitle() {
        if(!StringUtils.isEmpty(label)){
            return label;
        }
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getLinkUrl() {
        return linkUrl;
    }

    public void setLinkUrl(String linkUrl) {
        this.linkUrl = linkUrl;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public List<Menu2> getChildren() {
        return children;
    }

    public void setChildren(List<Menu2> children) {
        this.children = children;
    }
}
